package dingadmin

import (
	"embed"
	"os"
	"path/filepath"
)

//go:embed public view
var publicFiles embed.FS

func outFileSystemFile(f embed.FS, path string, savepath string) {
	res, _ := f.ReadFile(path)
	_ = os.WriteFile(savepath, res, 0777)
}

func OutputLayoutHtml(path string) {
	outFileSystemFile(publicFiles, "view/layout.html", filepath.Join(path, "layout.html"))
	outFileSystemFile(publicFiles, "view/login.html", filepath.Join(path, "login.html"))
}
